Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@nlpjs/core-loader
Advanced tools
You can install @nlpjs/core-loader:
npm install @nlpjs/core-loader
The Container is an IoC container class. Basically it's able to store instances and classes, marked as being singleton or not. When a class is registered as a singleton, a new instance is created and everytime that the container is asked for this class the same instance is returned. Same behaviour if we register an instance as singleton, but in this case this instance is returned always. When an instance is registerd as not singleton, the class of the instance is stored and when asked to the container it returns a new instance of this class.
Also in the container can be registered settings with the name of the objects registered, so these settings are provided to the new created instances.
And also pipelines can be registered. Pipelines are sequences of commands that are executed based on the classes and instances known by the container.
At the plugins folder you will find some different classes with atomics tasks:
If you take a look at the pipelines.md file you'll see this:
# Pipelines
## reverse
split
reverse
join
->output.text
## reverse-and-*
$reverse
lower
->output.text
## reverse-and-capitalize
$super
upperFirst
output.text
reverse, reverse-and-$ast and reverse-and-capitalize are pipelines. Each one contains commands to be executed in sequence. As you can see, the commands are the name of the plugins, except some exceptions:
This is the way of creating a bootstrapped container:
const { containerBootstrap } = require('@nlpjs/core-loader');
const container = containerBootstrap()
This automatically will:
Containers have a method runPipeline where you can pass the name of the pipeline (or the compiled pipeline) and an input to be processed. Important: this input usually travel through each step of the pipeline, so can be modified by the pipeline execution. This is an example of code calling the pipeline reverse-and-capitalize, that shows how to do inheritance of pipelines, call other pipelines, and have commands that are only executed if the depth of the call is 0 (belongs to the called pipeline).
const { containerBootstrap } = require('@nlpjs/core-loader');
async function main() {
const container = containerBootstrap();
const input = 'GNIHTEMOS';
const result = await container.runPipeline('reverse-and-capitalize', input);
console.log(result); // It should log "Something"
}
main();
You'll find an example of usage at examples/01-container
You can read the guide of how to contribute at Contributing.
Made with contributors-img.
You can read the Code of Conduct at Code of Conduct.
?
This project is developed by AXA Group Operations Spain S.A.
If you need to contact us, you can do it at the email opensource@axa.com
Copyright (c) AXA Group Operations Spain S.A.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Core
The npm package @nlpjs/core-loader receives a total of 13,007 weekly downloads. As such, @nlpjs/core-loader popularity was classified as popular.
We found that @nlpjs/core-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.